package ru.mirent;

import org.junit.jupiter.api.Test;
import ru.mirent.exceptions.CustomRuntimeException;

public class CustomRuntimeExceptionTest {

    @Test
    void throwExceptionTest() {
        throw CustomRuntimeException.builder().build();
    }

    @Test
    void throwExceptionWithMessageTest() {
        String message = "Сообщение об ошибке";
        String expected = "Текст для сравнения 1";
        String actual = "Текст для сравнения 2";
        String errorMessage = String.format("%s:expected: <%s> but was: <%s>", message, expected, actual);

        throw CustomRuntimeException.builder().message(message).build();
    }

    @Test
    void throwExceptionWithMessageAndAttachmentTest() {
        throw CustomRuntimeException.builder().message("123").attachment("qwe").build();
    }
}
